﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using System.Data;
using System.Data.SqlClient;

namespace 联盟酒店
{
    public partial class 用户管理 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            showuserinfo();
        }
        public void showuserinfo()
        {
            gdvshowuserinfo.DataSource = UserInfoBLL.showuserinfo();
            gdvshowuserinfo.DataBind();
        }

        protected void btndelete_Command(object sender, CommandEventArgs e)
        {
            int id =Convert.ToInt32( e.CommandArgument);
            int r = UserInfoBLL.deleteuserinfo(id);
            if (r > 1)
            {
                Response.Write("<script>alert('删除成功')</script>");
                showuserinfo(); 
            }
            else 
            {
                Response.Write("<script>alert('删除失败')</script>");
            }
            
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            Response.Redirect("添加用户.aspx");
        }
    }
}